Skip to content

Fix library-cache-miss regression #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 2, 2019

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Oct 1, 2019

Yet another post-builder regression.

This allows a better memory management and avoids struct copy
operations.
@matthijskooijman
Copy link
Collaborator

Code looks good at first glance. I haven't tracked the builder and cli changes lately, but how is this a regression exactly? From the commit messages, you're changing the cache to use pointers for performance, and change == to equals to prevent pointer comparison?

@cmaglie
Copy link
Member Author

cmaglie commented Oct 1, 2019

The regression was in the struct comparison with == operator, before it was working because the struct had only strings inside.

The comparison with == works only if there are no pointers involved:

  • you must compare directly the structs (as values) and not pointers to the structs (otherwise the pointers will be different even if the "content" of the struct is the same)
  • the struct fields must all be values (non-pointers) for the same reason as above

PS I'm going to do another round of refactoring to simplify this part and to move it out of the legacy package, I'd like your review once done :-)

@cmaglie cmaglie merged commit cc73753 into master Oct 2, 2019
@cmaglie cmaglie deleted the cmaglie/fix-library-cache-miss-regression branch October 2, 2019 07:55
@cmaglie cmaglie self-assigned this Oct 2, 2019
@cmaglie cmaglie added this to the 0.6.0 milestone Oct 2, 2019
cmaglie added a commit to arduino/arduino-builder that referenced this pull request Oct 2, 2019
This update will pick the followin fix in arduino-cli:

arduino/arduino-cli#433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants